package com.weilan.blog.base.validator.constraint;

import com.weilan.blog.base.validator.annotion.LongNotNull;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

/**
 * @description: 判断Long是否为空【校验器】
 * @author: 孙 峰
 * @time: 2020/9/23 14:11
 */
public class LongValidator implements ConstraintValidator<LongNotNull, Long> {

    @Override
    public void initialize(LongNotNull constraintAnnotation) {

    }
    @Override
    public boolean isValid(Long value, ConstraintValidatorContext context) {
        if (value == null) {
            return false;
        }
        return true;
    }
}
